import Relay from "react-relay";

export default class SaveOthersMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { saveOthers }`;
    }

    getVariables() {
        return {
            argsInput: {
                qualityAsk:this.props.qualityAsk,
                packageAsk:this.props.packageAsk,
                logisticsAsk:this.props.logisticsAsk,
                payMode:this.props.payMode,
                dutyBreak:this.props.dutyBreak,
                checkAsk:this.props.checkAsk,
                templateId:this.props.templateId,
                templateName:this.props.templateName,
                userId:this.props.userId,
                enterpriseId:this.props.enterpriseId,
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on saveOthersPayload {
            saveOthers {
                errorCode
                value
                totalResult
                id
                orderTemplate{
                   name
                   tid
                   qualityAsk
                            packageAsk
                            logisticsAsk
                            payMode
                            dutyBreak
                            checkAsk
                }
                orderTemplates{
                   name
                   tid
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
              fragment on saveOthersPayload {
                    saveOthers {
                        errorCode
                        value
                        totalResult
                        id
                        orderTemplate{
                           name
                           tid
                           qualityAsk
                            packageAsk
                            logisticsAsk
                            payMode
                            dutyBreak
                            checkAsk
                        }
                        orderTemplates{
                           name
                           tid
                        }
                    }
                }
            `]
        }];
    }

}
